/**
 * Copyright (c) 2012, Camelot and/or its affiliates. All rights reserved.
 * Camelot PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.camelot.ccr.system.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.camelot.ccr.global.dao.genericimpl.GenericHibernateDaoImpl;
import com.camelot.ccr.global.util.Pager;
import com.camelot.ccr.global.util.Utility;
import com.camelot.ccr.system.dao.VideoDao;
import com.camelot.ccr.system.persistence.Video;

/**
 * <pre>
 * 车手
 * </pre>
 * @author Liu Jun
 * @version V0.1, 2014-5-20 下午10:30:05
 */
@Repository
public class VideoDaoImpl extends GenericHibernateDaoImpl<Video, String> implements VideoDao {

	/* (non-Javadoc)
	 * @see com.camelot.ccr.system.dao.DriverDao#findPageList(int, int, com.camelot.ccr.system.persistence.Driver)
	 */
	@Override
	public Pager<Video> findPageList(int curpage, int pageSize, Video example) {
		StringBuilder sb = new StringBuilder("from Video d where 1=1  ");
		List<Object> parameList = new ArrayList<Object>();
		if(Utility.isNotEmpty(example.getType())){
			sb.append(" and d.type = ? ");
			parameList.add(example.getType());
		}
		return (Pager<Video>) queryListPageByHql(sb.toString(), curpage, pageSize, parameList);
	}

}
